package com.zc.study.thread.多线程第七章节.SolveTwo;

import java.text.SimpleDateFormat;
import java.util.SimpleTimeZone;

public class DateTools {
    private static ThreadLocal<SimpleDateFormat> t = new ThreadLocal<>();
    public static SimpleDateFormat getSimpleDateFormat(String format){
        SimpleDateFormat sdf =null;
        sdf=t.get();
        if(sdf == null){
            sdf = new SimpleDateFormat(format);
            t.set(sdf);
        }
        return sdf;
    }
}
